/**
 * +======================================================================================================================+
 * @Author: CimZzz
 * @Date: 2023-03-07 16:05:00
 * 
 * 代码分割块，以下内容涉及: 
 * 
 * 悬浮引用测试
 * 
 */

#include <cstdio>
#include <vector>

using namespace std;


vector<int>& foo1() {
	vector<int> v = {1, 2, 3, 4, 5};
	return v;
}

vector<int> foo2() {
	return {1, 2, 3, 4, 5};
}

int main(int argc, char ** argv) {
	auto a1 = foo1()[0];
	auto b1 = foo1()[1];

	printf("a1: %d, b1: %d\n", a1, b1);

	auto & a11 = foo1()[0];
	auto & b11 = foo1()[1];

	printf("a11: %d, b11: %d\n", a11, b11);

	auto a2 = foo2()[0];
	auto b2 = foo2()[1];

	printf("a2: %d, b2: %d\n", a2, b2);

	auto & a22 = foo2()[0];
	auto & b22 = foo2()[1];

	printf("a22: %d, b22: %d\n", a22, b22);

	return 0;
}